package me.sdau.spider.kafkaprocess.kafka.nlp.sdk;


import static me.sdau.spider.kafkaprocess.comm.constant.NLPConst.*;

/**
 * @author zj
 * @date 2018/4/3 14:02
 */
public class NlpFactory {

    public static NlpMethod get(String processor) {
        NlpMethod nlpMethod;

        switch (processor) {
            case SUMMARY: {
                nlpMethod = new Summary();
                break;
            }
            case KEYWORD: {
                nlpMethod = new KeyWords();
                break;
            }
            case CLASSIFITION: {
                nlpMethod = new Classifition();
                break;
            }
            case NEGATIVE_SCORE: {
                nlpMethod = new NegativeScore();
                break;
            }

            default: {
                // TODO 自定义异常
                throw new RuntimeException("创建对象失败");
            }
        }
        return nlpMethod;
    }
}
